app.controller("saveLayoutWindowCtrl", ["$scope", '$modalInstance','type','info', function($scope, $modalInstance,type,info){
    $scope.info={};
    $scope.info.attrInfo={};
    console.log(info.attr);
    console.log($scope.info.attrInfo);

    $scope.buttonsClick = function(x){
        console.log(x)
        if(x == 'save'){
            if(type == 'attrAdd'){
                info.attr.push($scope.info.attrInfo);
            }
            if(type == 'attrEdit'){

            }
            if(type == 'attrDel'){

            }
            $modalInstance.dismiss(true);
        }
        if(x == 'cancel'){
            $modalInstance.dismiss(false);
        }
    }

}])